package bootstrap

import (
	"certificate/api"
	"github.com/gin-gonic/gin"
)

func InitRouter() *gin.Engine {
	r := gin.Default()
	r.GET("/hello", func(c *gin.Context) {
		c.JSON(200, gin.H{
			"message": "Hello, World!",
		})
	})
	certificate := r.Group("/certificate")
	//抖音
	groupDouYin := certificate.Group("/douyin")

	groupDouYin.POST("/prepare", api.DouYinReady)
	groupDouYin.POST("/verify", api.DouYinVerify)
	groupDouYin.POST("/cancel", api.DouYinCancel)
	groupDouYin.POST("/get", api.DouYinGet)

	//美团
	groupMeituan := certificate.Group("/meituan")

	groupMeituan.POST("/prepare", api.MeituanReady)
	groupMeituan.POST("/verify", api.MeituanVerity)
	groupMeituan.POST("/cancel", api.MeituanCancel)
	groupMeituan.POST("/get", api.MeituanGet)

	return r
}
